$(function(){
   var roomId=$.getUrlVar('roomId');
       $.get("/index.php?m=Admin&c=room&a=read&id="+roomId,function(data){
        var str="";
        console.log(data);
        if(data.stat==1){
           $(".room_name").attr("value",data.data.full_parent_name+data.data.name);
           $(".room_id").attr("value",data.data.id);
        }else{
          console.log("未找到房屋信息");
        }
       
      });
   
 
    $("#form-family-add").Validform({
    tiptype:2,
    ajaxPost:true,
    showAllError:true,
    beforeSubmit:function(curform){
      curform.ajaxSubmit({
        type:'POST',
        url:'/index.php?m=Admin&c=family&a=add',
        success:function(data){
              if(data.stat==1){
                    info.pk=data.pk;
                   layer.msg("添加家庭成功，请继续添加成员",{time:500});   
                  // var index = parent.layer.getFrameIndex(window.name);
                  setTimeout(function(){
                         layer.close(info.index);
                  },1000);
                  
               }else{
                 layer.msg(data.msg);
               }
             
              }
        });
      return false;
    }
  });


   
});